A local area network (LAN) connects personal computers (PCs) together to enable the sharing of hardware and software among multiple users. The hardware components of a network comprise a plurality of individual user PC workstations, at least one server, network communications boards associated with each workstation and server, and electrical cables interconnecting the boards.
A server is a PC or other computer whose resources are made commonly available to the various network users. The most common type of server is a "file server," which typically includes a large capacity hard disk whose files are made accessible to all users. The network enables files to be read from and stored to the shared server disk, the same as if users were using separate hard disks located at each workstation. The workstation PCs execute files in the normal manner, except that the files are retrieved from and returned to the server hard disk. Both the workstations and the server have CPUs (central processing units) to perform the processing tasks of executing programs and controlling hardware operations.
High speed communications (1 million to 16 million bits per second) are made possible by installation of "network adapter" or "network interface" boards in the workstation and server PCs, and interconnecting the boards by cables. Files are transferred by the server's CPU to the server's board where they are translated into one or more "data packets" of, typically, 500 to 2,000 bytes each, transmitted via the cable to the requesting user's workstation board, then retranslated back into usable files to be acted upon by the workstation's CPU. Routing is under control of destination and source addressing information included with each packet according to a scheme of unique address numbers preassigned to each board.
A network operating system (OS) is the software that provides the set of instructions for operating the server hardware and for making the communications between workstations and server possible. This software corresponds to the disk operating system (PC DOS, OS/2, etc.) used by PCs operating independently in a non-networking manner. The network operating system controls the operation of the file server CPU, and cooperates with the workstation disk operating system to coordinate the use of network shared resources by managing disk access, file storage and memory utilization. Drive letters are assigned to the file server disk volumes, so that they can be accessed and manipulated with the workstation PC DOS or other disk operating system commands, the same as if they were part of the disk hardware on the individual workstation PCs.
NetWare 386.TM. is a network operating system written by Novell, Inc. It runs on 80386, 80486 and later CPUs, and permits up to 250 users to be accommodated by a single server. NetWare 386.TM. provides the network management functions needed for sharing files between a file server and multiple user PCs; and also provides security and sharing services for those files. NetWare 386.TM. also provides a capability for running in-house and third party developed application programs, such as database servers and communications gateways, on the server itself. These applications, known as NLMs (NetWare.TM. Loaded Modules), coexist with the network operating system in the server processor, in order to gain speed of access or special services not available elsewhere on the network.
A CPU does not normally read information directly from a hard disk but moves it first from hard disk to RAM (random-access memory), then reads it from RAM. Likewise, a CPU does not write information directly to hard disk but moves it first to RAM, then to hard disk. Thus, in order to enable multiple users to share the same disk resource efficiently, the server's RAM memory must likewise be used as a buffer between the individual workstation CPUs and the shared hard drive. With NetWare 386.TM. for instant access by the server CPU, the shared disk's directory of files and file allocation table (FAT) are stored in server memory by means of directory caching. NetWare 386.TM. also speeds up file locating by using directory hashing and file caching. The former provides for directory searching by subsets instead of file by file; the latter makes currently used disk-resident files more accessible by loading them into server memory on an automatic prerequest buffering basis.
NetWare 386.TM. allows the execution of both single-purpose commands (similar to single purpose DOS commands that perform one function, then stop running) and multipurpose NLMs (similar to DOS-based TSRs like MODE, FASTOPEN and GRAPHICS that terminate and stay resident in memory). Both the single-purpose commands and NLMs are executed from the server keyboard, run on the server CPU, and display output on the server display. Multiple programs are displayed on multiple windows or "screens." NLMs can be drivers that provide interfacing to particular hardware devices; utilities that enable the server to be configured, controlled or monitored; or name spaces that enable the sharing and manipulation of non-DOS files. Some NLMs come as part of the network operating system. The INSTALL NLM, for example, comes with NetWare 386.sup.TM and is used to install and configure the server. The MONITOR NLM also comes with NetWare 386.TM. and provides current server utilization statistics and information regarding the status of user connections. There is, however, a growing number of in-house and third party NLMs that do not come with the operating system, but must nevertheless be made compatible with it.
NLMs are advantageous over workstation run programs because the NLMs take advantage of the server resident benefits to perform tasks much more efficiently using the full capabilities of the server CPU, which is typically a more powerful processor than the CPU at a particular workstation. One type of NLM that is becoming popular is a database server or "engine," which responds to workstation inquiries for shared disk data, by performing database processing and file retrieval functions at the server level, thereby reducing network communications requirements.
Server execution of an NLM begins with a LOAD command, which loads the program into server RAM memory and continues to run it until it is unloaded by an UNLOAD command or automatic unloading procedure internal to the NLM program itself. For example, the INSTALL NLM module unloads itself when the EXIT option is selected from the main menu.
The MONITOR NLM can be used to identify the currently loaded NLMs and their memory usage (module's memory size and amount of server short-term memory in use at a particular time). When a server is booted, all unused memory is made available for caching. As memory is needed for other tasks, it is taken from the cache buffer pool. The MONITOR NLM identifies the number of memory buffers available for directory caching, file caching, and to receive incoming packets from workstations. The MONITOR NLM does not, however, identify individual memory allocations, deallocations and reallocations as they occur in the running of a particular NLM.
The network operating system, its data, and all currently loaded NLMs and their data reside in the file server's RAM memory. The dynamic allocation and reclamation of this memory is managed by the network operating system. For efficiency, the network operating system subdivides memory into several pools according to intended use. There are short-term, semipermanent, and permanent memory pools. The network operating system provides a set of functions which any NLM may call to request services. A subset of these calls deals with managing memory. The set of calls NetWare 386.TM. provides is called an Application Program Interface (API). The memory management functions that may be called are collectively referred to as the allocation API.
The pools of memory maintained by NetWare 386.TM. are referred to as "kernel memory," "permanent memory," "alloc memory" and "cache memory." These are described in Chapter 1 of Day & Neff, Troubleshooting NetWare for the 386, 1991, M&T Books, San Mateo, Calif.
"Kernel memory" is an area of memory in protected mode (above the 1MB address) into which is loaded the "kernel," or core code that performs the fundamental processing chores (including the memory manager component) of the network operating system. Kernel memory is static memory that remains dedicated to the kernel, so unavailable for reassignment whenever NetWare 386.TM. is running.
"Permanent memory" refers to memory dedicated to core data structures, like network communications buffers, and directory information, that remain in place for the duration of NetWare's execution Permanent memory is "semi-dynamic," in that it has a static base level configuration, which is augmented dynamically by allocations of "semi-permanent" memory from other pools when expansion is necessary. Once allocated, however, semi-permanent memory remains dedicated to the data structure for which it was allocated, and is not returned for reallocation elsewhere.
"Alloc memory" refers to memory allocated for short-term purposes, including use by NLMs. Alloc memory is maintained as a set of available memory addresses in a chain, or linked list, which is cycled through to fulfill NLM allocation requests. Using a linked list enables NetWare 386.TM. to initialize its alloc memory only once, but retain the ability to use the same chunk of memory repeatedly to fulfill allocation requests. Every time an NLM requires memory, NetWare 386.TM. delivers that memory to the NLM from the alloc memory pool. When the NLM is finished with the memory, it returns it back to the alloc memory pool. In this way, NetWare 386.TM. can "recycle" the memory by placing it back on the linked list of available alloc memory. If memory requirements of NLMs increase beyond the capacity of the initial alloc memory pool, more alloc memory can be appropriated from the cache memory pool; however, once taken, that memory is not returned to cache. To prevent cache depletion, therefore, a maximum size of the alloc memory pool is set, within predefined limits (viz. 50KB to 16MB, with a default maximum size of 2MB).
All memory not being used as kernel, permanent, semipermanent, or alloc memory is made available for file caching. "Cache memory" is the most dynamic memory pool, and individual buffers, which act as temporary file data storage areas, are being continually recycled. File cache memory is further divided into "non-moveable" and "moveable" cache memory. Nonmoveable cache memory is similar to alloc memory in that it is suitable for short-term usage, and is maintained in a linked list, from which it is allocated for use by NLMs or the like, and to which it is reclaimed. Non-moveable cache memory is, however, available for use as file cache buffers after being freed up by an NLM. Moveable cache memory is similar to unmovable cache memory, except that it can be relocated to different physical memory addresses in order to maintain an efficient mass or "heap" of total memory available for use by the operating system (i.e. to eliminate fragmentation). The "overhead" required to maintain moveable memory is not justified for short-term memory assignments. In a file server environment, NetWare 386.TM. uses all memory not required by the kernel or NLMs for file system caching.
The four main components of the NetWare 386.TM. operating system are the NetWare.TM. Loader, the kernel (already described above), the NLM environment, and the application services. See, Day & Neff, Ch. 1, supra. The NetWare.TM. Loader initializes the server's hardware and loads the kernel. It thereafter acts as a run-time linker, enabling dynamic loading (and unloading) of NLMs, permitting them access to the kernel. The linking process makes the addresses of executable routines of the NLM available to the operating system and, vice versa, makes certain kernel and other NLM function addresses available to the NLM. As already mentioned, the kernel is the heart of the operating system code and includes routines that provide its file system, scheduler, memory management and networking services. The NLM environment encompasses the loader and kernel and provides scheduling, memory management, and all resources needed to run NLMs. The application services are basic networking functions available both to NLMs running on the same server and to remote clients running on the same network.
The NLM environment includes a "C" library or CLIB component which acts as an interface between low-level routines of the operating system kernel and NLMs written in the "C" programming language. The CLIB is a special, low-level NLM that uses private labels and kernel "hooks" not made available for use by -third-party NLM developers. CLIB comprises a collection of function calls made "public" for use by other NLMs to gain access to the kernel of the operating system. This not only protects the kernel, but also insulates developers from version changes within the kernel. NLM developers are, thus, encouraged to write their C language NLMs using CLIB function calls, rather than addressing the kernel directly. Other programming language interfaces may be created using Assembly language interface documentation.
An NLM can call upon the NetWare 386.TM. allocation API to perform the following memory related functions: request for allocation of a block of memory from NetWare 386.TM. (alloc); return of a block of allocated memory back to NetWare 386.TM. (free); and request for a change in the size of an allocated block of memory (realloc). These functions are available to work with memory from the variety of memory pools described above. The value returned to the caller from execution of the alloc and realloc functions is called a pointer because it points to an address of a block of memory made available.
Errors can arise when working with memory allocation. If no memory is available when requested, a special pointer called the NULL pointer is returned to indicate the no memory available condition. It is an error for an NLM to free a pointer that never came from alloc or realloc, or to use the free function for one pool to free memory allocated from another pool. Finally, the NLM must be sure to free all memory it has allocated when it terminates. If the last requirement is not met, the NLM may interfere with normal functioning of the network operating system and will not be able to receive certification from Novell.
NetWare 386.TM. does not provide a way to track memory allocation errors dynamically while developing new NLM applications to run under NetWare 386.TM..